home *** CD-ROM | disk | FTP | other *** search
/ SuperHack / SuperHack CD.bin / CODING / DEMOS / CIVAX6.ZIP / COOL2.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1995-10-13  |  37.0 KB  |  1,560 lines

  1.  {$N+,G+}
  2.  
  3. program COOL_BBS_realy_good_intro;
  4.  
  5. uses dos,pic1,fnt1,crt;
  6.  
  7.  
  8. Type
  9.  
  10.     rgb     = array [1..3] of byte;
  11.     palet   = array [0..255] of rgb;
  12.     TabType = array [0..255] of shortint;
  13.     Virtu   = Array [1..64000] of byte;            { The size of our Virtual Screen }
  14.     VirtPtr = ^Virtu;                              { Pointer to the virtual screen }
  15.  
  16. Const
  17.  
  18.      Xc                      =  0;
  19.      Yc                      =  0;
  20.      Zc                      =  300;
  21.      Nofpoints               =  7;
  22.      Nofpolys                =  5;
  23.      PhiX          :    byte =  0;
  24.      Phiy          :    byte =  0;
  25.      Phiz          :    byte =  0;
  26.      zoff          : Integer =  200;
  27.      xoff          : Integer =  160;
  28.      yoff          : Integer =  100;
  29.      vseg                    =  $A000;             {video segment}
  30.      VekMax                  =  10;
  31.      Xstep                   =  -3;
  32.      Ystep                   =   1;
  33.      Zstep                   =  -2;
  34.  
  35.      Point : array [0..Nofpoints,0..2] of integer =
  36.             (
  37.              ( -50 ,  50 ,  50 ), {up}
  38.              ( -50 ,  50 , -50 ),
  39.              (  50 ,  50 , -50 ),
  40.              (  50 ,  50 ,  50 ),
  41.              ( -50 , -50 ,  50 ), {down}
  42.              ( -50 , -50 , -50 ),
  43.              (  50 , -50 , -50 ),
  44.              (  50 , -50 ,  50 )
  45.             );
  46.  
  47.      Polyst : Array [0..Nofpolys,0..3] of byte =
  48.               (  {up}     {down}     {in}
  49.                (1,0,3,2),(5,4,7,6),(1,5,6,2),
  50.                {out}    {left}    {right}
  51.                (0,4,7,3),(1,5,4,0),(2,6,7,3)
  52.               );
  53.  
  54.      Polcols : Array [0..Nofpolys] of byte = ( 20,22,24,26,28,30 );
  55.  
  56. var
  57.  
  58.    PInd                 : Array [0..Nofpolys] of integer;
  59.    Polyz                : array [0..Nofpolys] of Integer;
  60.    I                    : integer;
  61.    SinTab               : TabType;
  62.    j,shaq               : Byte;
  63.    virscr               : VirtPtr;
  64.    s,o,vad              : word;
  65.    plg                  : array [1..4,1..2] of integer;
  66.    ch                   : char;
  67.    pc                   : Integer;
  68.    polyx,polyy          : array [0..2] of word;
  69.    px,py,pz             : array [0..nofpoints] of integer;
  70.    X,Y,Z,X1,Y1,Z1       : integer;
  71.    F                    : File;
  72.    P                    : Pointer;
  73.    Pal                  : Palet;
  74. {---------------------------------------------------}
  75.  
  76. type
  77.  
  78.        Palette    = Array[0..255,1..3]       of Byte;
  79.        Str80 = String[80];
  80.        FONT_LETTER = array[0..15] of byte;
  81.        FONT_ARRAY = array[0..255] of font_letter;
  82.  
  83.  
  84. label jm1;    {was in use in some of the plays}
  85.  
  86. const           {this word is very deep.  Lets stop n' think
  87.                  about it for a while.}
  88.  
  89.       BITMAP:array[0..7] of byte = (128,64,32,16,8,4,2,1);
  90.       LINEWIDTH:WORD=320;
  91.       SHADOW:boolean=false; {false;}
  92.       SHADOWCOL:byte=37;
  93.       UNDERLINE:boolean=false;
  94.       UNDERCOL:byte=0;
  95.       PROPOR:boolean=true;
  96.       NODRAWCOL:byte = 0;
  97.  
  98.  
  99.   range = 35;   {What, finished thinking?!}
  100.   rang = 17;
  101.  
  102. var
  103.      font1     : font_array;
  104.  Pic1Pal:palette;
  105.  Pic1Seg,Pic1Ofs:Word;
  106.   eee:byte;
  107.   TOP,BOTTOM,ii:WORD;
  108.   imb,yay,counter,mult:byte;
  109.   sins : array[0..range] of shortint;
  110.   lin : word;
  111.   orr:boolean;
  112.  
  113.  
  114. {$M 65520, 0, 655360}
  115.  
  116.  
  117. const
  118.   MaxX = 319;
  119.   MaxY = 199;
  120.   HalfX = MaxX div 2;
  121.   HalfY = MaxY div 2;
  122.   ShadeRad : integer = 8;
  123.   ColBackGd : integer = 28;
  124.   Pal2Rot : boolean = false;
  125.   deltarad : boolean = false;
  126.  
  127. type
  128.   ColorValue = record
  129.     red, green, blue: byte;
  130.   end;
  131.  
  132.   PaletteType = array [0..255] of ColorValue;
  133.  
  134.   pointrec3d = record
  135.     x, y, z : integer
  136.   end;
  137.   pointarray3d = array [1..10] of pointrec3d;
  138.  
  139.   pointrec2d = record
  140.     x, y, z, r, c : integer
  141.   end;
  142.   pointarray2d = array [1..10] of pointrec2d;
  143.  
  144.   buffrec = record
  145.     x, y : integer
  146.   end;
  147.   buffarray = array [1..10] of array [1..10] of buffrec;
  148.  
  149. var
  150.   palee   : palettetype;
  151.   pt    : pointarray3d;
  152.   p2    : pointarray2d;
  153.   ptend : integer;
  154.   b     : buffarray;
  155.   bobbing, SBob : boolean;
  156.   oldclockvec : procedure;
  157.   putlinepixel : procedure (x, y : integer; color : byte);
  158.   first, second : ColorValue;
  159.   pal2 : palettetype;
  160.   d_rads : array [1..5] of integer;
  161.  
  162.  
  163.  
  164.  
  165.  
  166. TYPE HSC_Song = RECORD
  167.                   Song     : POINTER;
  168.                   SongSize : WORD;
  169.                   FileName : STRING;
  170.                   SongOK   : BOOLEAN;
  171.                 END;
  172.      HSC_Info = ARRAY [0..39] OF BYTE;
  173.  
  174. VAR Musik   : HSC_Song;
  175.     Info    : HSC_Info;
  176.     HeadPtr : WORD ABSOLUTE $40:$1A;
  177.     TailPtr : WORD ABSOLUTE $40:$1C;
  178.  
  179. {$F+}
  180. {$L HSCOBJ.OBJ}
  181. PROCEDURE _HscPlayer; EXTERNAL;
  182.  
  183. PROCEDURE StartMusic (Song : POINTER; Polling, OldIRQ : BOOLEAN); ASSEMBLER;
  184.   ASM
  185.     MOV  AH,0
  186.     MOV  BL,Polling
  187.     MOV  BH,OldIRQ
  188.     CMP  BH,1
  189.     JE   @Invert
  190.     MOV  BH,1
  191.     JMP  @GoOn
  192.   @Invert:
  193.     XOR  BH,BH
  194.   @GoOn:
  195.     LES  SI,DWORD PTR Song
  196.     CALL _HscPlayer
  197.   END;
  198.  
  199. PROCEDURE PollMusic; ASSEMBLER;
  200.   ASM
  201.     MOV  AH,1
  202.     CALL _HscPlayer
  203.   END;
  204.  
  205. PROCEDURE StopMusic; ASSEMBLER;
  206.   ASM
  207.     MOV  AH,2
  208.     CALL _HscPlayer
  209.   END;
  210.  
  211. FUNCTION  DetectAdlib (SuggestedPort : WORD) : WORD; ASSEMBLER;
  212.   ASM
  213.     MOV  AH,4
  214.     MOV  BX,SuggestedPort
  215.     CALL _HscPlayer
  216.     JNC  @GoOn
  217.     MOV  AX,0FFh
  218.   @GoOn:
  219.   END;
  220.  
  221. PROCEDURE ToggleRasterBar; ASSEMBLER;
  222.   ASM
  223.     MOV  AH,5
  224.     CALL _HscPlayer
  225.   END;
  226.  
  227. PROCEDURE SetUserIRQ (Link : BOOLEAN; Routine : POINTER); ASSEMBLER;
  228.   ASM
  229.     PUSH DS
  230.     MOV  AH,6
  231.     MOV  BL,Link
  232.     LDS  DX,DWORD PTR Routine
  233.     CALL _HscPlayer
  234.     POP  DS
  235.   END;
  236.  
  237. PROCEDURE GetPlayerState (VAR Destination); ASSEMBLER;
  238.   ASM
  239.     MOV  AH,7
  240.     LES  SI,DWORD PTR Destination
  241.     CALL _HscPlayer
  242.   END;
  243.  
  244. Procedure HSC001; external;
  245. {$L HSC1.OBJ}
  246.  
  247. PROCEDURE LoadSong (VAR Dest : HSC_Song);
  248.   VAR F : FILE;
  249.   BEGIN
  250.         BEGIN
  251.           Dest.SongSize := 10804;
  252.           GETMEM (Dest.Song,Dest.SongSize);
  253.           Move(Mem[Seg(HSC001):Ofs(HSC001)],Mem[Seg(Dest.Song^):Ofs(Dest.Song^)],Dest.SongSize);
  254.           Dest.SongOK := TRUE;
  255.         END
  256.   END;
  257.  
  258. PROCEDURE ClearSong (VAR Dest : HSC_Song);
  259.   BEGIN
  260.     Dest.SongOK := FALSE;
  261.     FREEMEM (Dest.Song,Dest.SongSize);
  262.     Dest.SongSize := 0
  263.   END;
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.  
  272.  
  273.  
  274. {---------------------------------------------------}
  275.  
  276.  
  277. procedure putpixel(x,y:word;col:byte); assembler;
  278. var add:word;
  279.  asm
  280.         mov ax,y
  281.         mul LineWidth
  282.         add ax,x
  283.         mov di,ax
  284.  
  285.         mov bx,0a000h              {                                    }
  286.         mov es,bx                  { * set ES:DI to video screen memory }
  287.         mov cl,col                 { * set cl to the color              }
  288.         mov es:[di],cl             { * write the color to the screen    }
  289. @nodraw:
  290. end;
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297. procedure EatKeypress;
  298.  
  299.   var
  300.     ch : char;
  301.  
  302.   begin
  303.     if keypressed then
  304.       begin
  305.         ch := readkey;
  306.         if ch in [#17, #24, #27] then halt;   { Ctrl-Q, Ctrl-X, Escape key }
  307.         if ch = #0 then
  308.           begin
  309.             ch := readkey;
  310.             if ch in [#16, #45, #68] then halt;  { Alt-Q, Alt-X, F10 }
  311.           end
  312.       end;
  313.   end;
  314.  
  315.  
  316. Function ISqrt(a:word):integer;
  317. begin
  318.   Isqrt:=round(sqrt(a));
  319. end;
  320.  
  321. procedure ModeVGA; assembler;
  322.  
  323.   asm
  324.     mov ax, 0013h
  325.     int 10h
  326.   end;
  327.  
  328.  
  329. function getpixel (a, b : integer) : byte;
  330.  
  331.   begin
  332.     GetPixel := mem[$A000:word(320*b+a)]
  333.   end;
  334.  
  335. procedure Swap (var a, b : integer);
  336.  
  337.   var
  338.     t : integer;
  339.  
  340.   begin
  341.     t := a;
  342.     a := b;
  343.     b := t
  344.   end;
  345.  
  346. procedure HLiner (x1, x2, y : integer; color : byte);
  347.  
  348.   begin
  349.     if x2 < x1 then
  350.       swap(x1,x2);
  351.     if x1 < 0 then x1 := 0;
  352.     if x1 > MaxX then x1 := MaxX;
  353.     if x2 < 0 then x2 := 0;
  354.     if x2 > MaxX then x2 := MaxX;
  355.     if (y > 0) and (y < MaxY) then
  356.       fillchar(mem[$A000:x1+y*320],x2-x1+1,color);
  357.   end;
  358.  
  359. procedure VLiner (x, y1, y2 : integer; color : byte);
  360.  
  361. { Draws a vertical line.  Apple ][e BASIC command. }
  362.  
  363.   var
  364.     y : integer;
  365.  
  366.   begin
  367.     if y1 > y2 then swap (y1, y2);
  368.     for y := y1 to y2 do
  369.       PutPixel (x, y, Color)
  370.   end;
  371.  
  372. Procedure Line(x1,y1,x2,y2:integer;color:byte); assembler;
  373. var
  374.   diagonal_x_increment,
  375.   diagonal_y_increment,
  376.   short_distance,
  377.   straight_x_increment,
  378.   straight_y_increment,
  379.   straight_count,
  380.   diagonal_count:integer;
  381. asm
  382.   mov ax, $a000 { Set up segment for output }
  383.   mov es,ax
  384.   mov cx,1 { Set initial increments for each pixel position }
  385.   mov dx,1
  386.   mov di,y2 { Calculate Vertical distance }
  387.   sub di,y1
  388.   jge @keep_y
  389.   neg dx
  390.   neg di
  391. @Keep_Y:
  392.   mov diagonal_y_increment,dx
  393.   mov si,x2 { Calculate horizontal distance }
  394.   sub si,x1
  395.   jge @keep_x
  396.   neg cx
  397.   neg si
  398. @Keep_X:
  399.   mov diagonal_x_increment,cx
  400.   cmp si,di { Figure whether straight segments are horizontal or vertical }
  401.   jge @horz_seg
  402.   mov cx,0
  403.   xchg si,di
  404.   jmp @Save_Values
  405. @Horz_seg:
  406.   mov dx,0
  407. @Save_values:
  408.   mov short_distance,di
  409.   mov straight_x_increment,cx
  410.   mov straight_y_increment,dx
  411.   mov ax,short_distance { Calculate adjustment factor }
  412.   shl ax,1
  413.   mov straight_count,ax
  414.   sub ax,si
  415.   mov bx,ax
  416.   sub ax,si
  417.   mov diagonal_count,ax
  418.   mov cx,x1 { prepare to draw the line }
  419.   mov dx,y1
  420.   inc si
  421.   mov al,color
  422. @MainLoop: { Now draw the line }
  423.   dec si
  424.   jz  @line_finished
  425.   { Plot Pixel }
  426.   push ax
  427.   push bx
  428.   push cx
  429.   push dx
  430.   push si
  431.  
  432.   push cx
  433.   push dx
  434.   push ax
  435.   call putlinepixel
  436.  
  437.   pop  si
  438.   pop  dx
  439.   pop  cx
  440.   pop  bx
  441.   pop  ax
  442.   { End Plot Pixel }
  443.   cmp bx,0
  444.   jge @diagonal_line
  445.   add cx,straight_x_increment { Draw Stright Line Segments }
  446.   add dx,straight_y_increment
  447.   add bx,straight_count
  448.   jmp @MainLoop
  449. @Diagonal_line: { Draw Diagonal Line Segments }
  450.   add cx,diagonal_x_increment
  451.   add dx,diagonal_y_increment
  452.   add bx,diagonal_count
  453.   jmp @MainLoop
  454. @Line_Finished:
  455. end;
  456.  
  457. procedure fillcircle (x_center, y_center, radius, color : word);
  458.  
  459.   var
  460.     x,y,r2:integer;
  461.  
  462.   begin
  463.     if radius=0 then exit;
  464.     r2:=radius*radius;
  465.     x:=0;
  466.     y:=radius;
  467.     repeat
  468.       hliner(x_center-x,x_center+x,y_center-y, color);
  469.       hliner(x_center-x,x_center+x,y_center+y, color);
  470.       hliner(x_center-y,x_center+y,y_center-x, color);
  471.       hliner(x_center-y,x_center+y,y_center+x, color);
  472.       inc(x);
  473.       y:=isqrt(r2-x*x);
  474.     until x>y;
  475.   end;
  476.  
  477. procedure ShadeBobCirc (x_center, y_center, radius : word; sb : boolean);
  478.  
  479.   var
  480.     x,y,r2:integer;
  481.  
  482.   procedure ahline (x, x2, y : integer);
  483.  
  484.    { Anti - hline shadebob }
  485.  
  486.     var
  487.       xloop, c : integer;
  488.  
  489.     begin
  490.       for xloop :=  x to x2 do
  491.         begin
  492.           c := getpixel (xloop, y);
  493.           dec (c);
  494.           if c < 0 then c := 140;
  495.           if bobbing and (c < ColBackGd) then c := ColBackgd;
  496.           putpixel (xloop, y, c);
  497.         end;
  498.  
  499.     end;
  500.  
  501.   procedure hliner (x, x2, y : integer);
  502.  
  503.     var
  504.       xloop, c : integer;
  505.  
  506.     begin
  507.       for xloop :=  x to x2 do
  508.         begin
  509.           c := getpixel (xloop, y);
  510.           inc (c);
  511.           if bobbing and (c > 140) then c := ColBackGd
  512.             else
  513.           if c > 140 then c := 0;
  514.           putpixel (xloop, y, c);
  515.         end;
  516.     end;
  517.  
  518.   begin
  519.     if radius=0 then exit;
  520.     r2:=radius*radius;
  521.     x:=0;
  522.     y:=radius;
  523.     repeat
  524.       if sb then
  525.         begin
  526.           hliner(x_center-x,x_center+x,y_center-y);
  527.           hliner(x_center-x,x_center+x,y_center+y);
  528.           hliner(x_center-y,x_center+y,y_center-x);
  529.           hliner(x_center-y,x_center+y,y_center+x);
  530.         end
  531.       else
  532.         begin
  533.           ahline(x_center-x,x_center+x,y_center-y);
  534.           ahline(x_center-x,x_center+x,y_center+y);
  535.           ahline(x_center-y,x_center+y,y_center-x);
  536.           ahline(x_center-y,x_center+y,y_center+x);
  537.         end;
  538.       inc(x);
  539.       y:=isqrt(r2-x*x);
  540.     until x>y;
  541.   end;
  542.  
  543. procedure getdata;
  544.  
  545.   var
  546.     loop : integer;
  547.  
  548.   begin
  549.     pt [1].x := -20;
  550.     pt [1].y := 0;
  551.     pt [1].z := 0;
  552.     pt [2].x := 0;
  553.     pt [2].y := 0;
  554.     pt [2].z := 20;
  555.     pt [3].x := 20;
  556.     pt [3].y := 0;
  557.     pt [3].z := 0;
  558.     pt [4].x := 0;
  559.     pt [4].y := 0;
  560.     pt [4].z := -20;
  561.     pt [5].x := 0;
  562.     pt [5].y := 20;
  563.     pt [5].z := 0;
  564.  
  565.     for loop := 1 to 10 do
  566.       begin
  567.       end;
  568.   end;
  569.  
  570. function rad (a : real) : real;
  571.  
  572.   begin
  573.     rad := a * pi / 180
  574.   end;
  575.  
  576. procedure rotatearray (lrtheta, udtheta, circtheta : real;
  577.   xshift, yshift, zoom: integer);
  578.  
  579.   var
  580.     xa, ya, ca, e, f,
  581.     cud, sud, clr, slr, cc, sc : real;
  582.     loop : integer;
  583.  
  584.   begin
  585.     cud := cos (udtheta);
  586.     sud := sin (udtheta);
  587.     clr := cos (lrtheta);
  588.     slr := sin (lrtheta);
  589.     cc := cos (circtheta);
  590.     sc := sin (circtheta);
  591.     for loop := 1 to ptend do
  592.       begin
  593.         xa := (clr * pt [loop].x) - (slr * pt [loop].z);
  594.         ca := (slr * pt [loop].x) + (clr * pt [loop].z);
  595.         e := (cc * xa) + (sc * pt [loop].y);
  596.         ya := (cc * pt [loop].y) - (sc * xa);
  597.         p2 [loop].z := round ((cud * ca - sud * ya) * zoom);
  598.         f := (sud * ca) + (cud * ya);
  599.         p2 [loop].x := round (e * zoom + xshift);
  600.         p2 [loop].y := round (f * zoom + yshift);
  601.       end;
  602.     for loop := 10 downto 2 do
  603.       b [loop] := b [loop - 1];
  604.     for loop := 1 to ptend do
  605.       begin
  606.         b [1, loop].x := p2 [loop].x;
  607.         b [1, loop].y := p2 [loop].y;
  608.       end
  609.   end;
  610.  
  611. procedure putdata;
  612.  
  613.   var
  614.     loop, loop2, loop3, r, dy, dx, y, x : integer;
  615.  
  616.   begin
  617.     loop := 0;
  618.     dy := 1;
  619.     dx := 1;
  620.     y := halfy;
  621.     x := halfx;
  622.     while not keypressed do
  623.       begin
  624.     inc (x, dx);
  625.     inc (y, dy);
  626.     if (dx = 1) and (x > MaxX - 50) then dx := -1;
  627.     if (dx = -1) and (x < 50) then dx := 1;
  628.     if (dy = 1) and (y > MaxY - 50) then dy := -1;
  629.     if (dy = -1) and (y < 50) then dy := 1;
  630.  
  631.     rotatearray (rad (loop), rad (loop), 0, x, y, 2);
  632.  
  633.     for loop2 := 1 to ptend do
  634.       ShadeBobCirc (b [1, loop2].x, b [1, loop2].y, 8, true);
  635.  
  636.     for loop2 := 1 to ptend do
  637.       if (b [10, loop2].x <> 0) or (b [10, loop2].x <> 0)
  638.         or (b [10, loop2].y <> 0) or (b [10, loop2].y <> 0) then
  639.           ShadeBobCirc (b [10, loop2].x, b [10, loop2].y, 8, false);
  640.  
  641.     inc (loop, 10);
  642.     if loop = 360 then loop := 0;
  643.  
  644.     end;
  645.   end;
  646.  
  647. procedure ShadeBob (x1, y1, x2, y2 : integer);
  648.  
  649.   var
  650.     x, y : integer;
  651.  
  652.   begin
  653.     x := x1;
  654.     y := y1;
  655.     ShadeBobCirc (x, y, shaderad, SBob);
  656.     while (x <> x2) or (y <> y2) do
  657.       begin
  658.         if x > x2 then dec (x) else if x < x2 then inc (x);
  659.         if y > y2 then dec (y) else if y < y2 then inc (y);
  660.         ShadeBobCirc (x, y, shaderad, SBob)
  661.       end;
  662.     EatKeyPress;
  663.   end;
  664.  
  665. procedure ShowPhone;
  666.  
  667.   var
  668.     tempnum, tempnum2, tempnum3 : ColorValue;
  669.     loopy : integer;
  670.  
  671.   begin
  672.     shaderad := 2;
  673.  
  674.     { 972-7-731239 }
  675.  
  676. {}  ShadeBob (20,150, 40,150);
  677.     ShadeBob (40,150, 40,170);
  678.     ShadeBob (40,170, 20,170);
  679.     ShadeBob (40,160, 20,160);
  680.     ShadeBob (20,160, 20,150);{}      {9}
  681. {}  ShadeBob (45,150, 65,150);
  682.     ShadeBob (65,150, 55,170);{}      {7}
  683. {}  ShadeBob (70,150, 90,150);
  684.     ShadeBob (90,150, 90,160);
  685.     ShadeBob (90,160, 70,160);
  686.     ShadeBob (70,160, 70,170);
  687.     ShadeBob (70,170, 90,170);{}      {2}
  688. {}  ShadeBob (99,160,108,160);{}      {-}
  689. {}  ShadeBob (110,150,130,150);
  690.     ShadeBob (130,150,120,170);{}     {7}
  691. {}  ShadeBob (135,160,145,160);{}     {-}
  692.     shaderad:=3;
  693. {}  ShadeBob (150,145,170,145);
  694.     ShadeBob (170,145,160,175);{}     {7}
  695. {}  ShadeBob (180,145,200,145);
  696.     ShadeBob (200,145,200,175);
  697.     ShadeBob (200,175,180,175);
  698.     ShadeBob (180,160,200,160);{}     {3}
  699. {}  ShadeBob (210,145,210,175);{}     {1}
  700. {}  ShadeBob (220,145,240,145);
  701.     ShadeBob (240,145,240,160);
  702.     ShadeBob (240,160,220,160);
  703.     ShadeBob (220,160,220,175);
  704.     ShadeBob (220,175,240,175);{}     {2}
  705. {}  ShadeBob (250,145,270,145);
  706.     ShadeBob (270,145,270,175);
  707.     ShadeBob (270,175,250,175);
  708.     ShadeBob (250,160,270,160);{}     {3}
  709. {}  ShadeBob (300,160,280,160);
  710.     ShadeBob (280,160,280,145);
  711.     ShadeBob (280,145,300,145);
  712.     ShadeBob (300,145,300,175);
  713.     ShadeBob (300,175,280,175);{}     {9}
  714.  
  715.   end;
  716.  
  717.  
  718.  
  719.  
  720.  
  721.  
  722.  
  723.  
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730. {-----------------}
  731.  
  732. Procedure sc(col,r,g,b:byte);     {Set color routine.  Isn't it boring?!}
  733. begin
  734.      port[$3c8]:=col;
  735.      port[$3c9]:=r;
  736.      port[$3c9]:=g;
  737.      port[$3c9]:=b;
  738. end;
  739.  
  740.  
  741.  
  742. Procedure putpal(pal:palet);      {Put the Palette.  Gee, what a thrill!}
  743. var
  744.    i:byte;
  745. begin
  746.      for i:=0 to 255 do
  747.          sc(i,pal[i,1],pal[i,2],pal[i,3]);
  748. end;
  749.  
  750.  
  751. Procedure rotpal(fp,tp:byte;var pal:palet);   {Cycle the colors. }
  752. var
  753.    r:rgb;
  754. begin
  755.      move(pal[fp,1],r[1],3);
  756.      move(pal[fp+1,1],pal[fp,1],(tp-fp)*3);
  757.      move(r[1],pal[tp,1],3);
  758.      PUTPAL(PAL);
  759. end;
  760.  
  761.  
  762.  
  763. Procedure UpdPalette(Pallt:Palette);
  764. Var
  765.  AA:Word;
  766. Begin
  767.  For AA:=0 to 255 do SC(AA,Pallt[AA,1],Pallt[AA,2],Pallt[AA,3]);
  768. End;
  769.  
  770.    {---------------------}
  771.  
  772. Procedure Delay(ms : Word); Assembler;
  773. Asm {machine independent Delay Function}
  774.   mov ax, 1000;
  775.   mul ms;
  776.   mov cx, dx;
  777.   mov dx, ax;
  778.   mov ah, $86;
  779.   int $15;
  780. end;
  781.  
  782. Function KeyPressed : Boolean;
  783. Var
  784.   IsThere : Byte;
  785. begin
  786.   Inline(
  787.     $B4/$0B/               {    MOV AH,+$0B         ;Get input status}
  788.     $CD/$21/               {    INT $21             ;Call Dos}
  789.     $88/$86/>ISTHERE);     {    MOV >IsThere[BP],AL ;Move into Variable}
  790.   KeyPressed := (IsThere = $FF);
  791. end;
  792.  
  793. Function ReadKey : Char;  { Replacement For Crt.ReadKey }
  794. Var
  795.   chrout : Char;
  796. begin
  797.   {  ;Just like ReadKey in Crt Unit}
  798.   Inline(
  799.   $B4/$07/               {  MOV AH,$07          ;Char input w/o echo}
  800.   $CD/$21/               {  INT $21             ;Call Dos}
  801.   $88/$86/>CHROUT);      {  MOV >chrout[bp],AL  ;Put into Variable}
  802. (*  if CheckBreak and (chrout = #3) then  {if it's a ^C and CheckBreak True}
  803.   {then execute Ctrl_Brk}
  804.     Inline($CD/$23);           {     INT $23}  *)
  805.   ReadKey := chrout;                    {else return Character}
  806. end;
  807.  
  808. Procedure wobbler(top,bottom,mult:byte);      {Here is the fuck'n routine!}
  809. begin
  810.   lin := 320 * yay;
  811.   move(ptr(s,o+lin)^,mem[$a000:lin + sins[imb] +1],320 - sins[imb] -2);
  812.   inc(imb);
  813. if imb > range then imb := 0;
  814.   inc(yay);
  815. if yay > bottom then
  816. begin
  817.   yay := top;
  818.     if counter > 1 then dec(counter,2) else counter := range;
  819.   imb := counter
  820. end;
  821. {
  822. inc(eee);
  823. if eee=7 then begin
  824.                eee:=0;
  825.                rotpal(1,175,pal);
  826.               end;
  827.  }
  828. end;
  829.  
  830.  
  831.  
  832.  
  833.  
  834.  
  835.  
  836.  
  837.  
  838. Procedure SetUpVirtual; { This sets up the memory needed for the virtual screen }
  839. BEGIN
  840.   GetMem (VirScr,64000);
  841.   vad := seg (virscr^);
  842. END;
  843.  
  844. Procedure ShutDown; { This frees the memory used by the virtual screen }
  845. BEGIN
  846.   FreeMem (VirScr,64000);
  847. END;
  848.  
  849. procedure flip(source,dest:Word); { This copies the entire screen at "source" to destination }
  850. begin
  851.   asm
  852.     push    ds
  853.     mov     ax, [Dest]
  854.     mov     es, ax
  855.     mov     ax, [Source]
  856.     mov     ds, ax
  857.     xor     si, si
  858.     xor     di, di
  859.     mov     cx, 32000
  860.     rep     movsw
  861.     pop     ds
  862.   end;
  863. end;
  864.  
  865. procedure Calcsinus(var SinTab : TabType);
  866. var
  867.    I : byte;
  868. begin
  869.      for I := 0 to 255 do
  870.          SinTab[I] := round(sin(2*I*pi/255)*127);
  871. end;
  872.  
  873. Procedure Hline (x1,x2,y:word;col:byte;where:word;yn:boolean); assembler;
  874. asm
  875.   push  es
  876.   push  ds
  877.   mov   ax,vad
  878.   mov   es,ax
  879.   mov   ax,Where
  880.   mov   ds,ax
  881.   cld
  882.  
  883.   mov   ax,y
  884.   mov   di,ax
  885.   shl   ax,8
  886.   shl   di,6
  887.   add   di,ax
  888.   add   di,x1
  889.  
  890.   mov   si,di
  891.   mov   al,col
  892.   mov   ah,al
  893.   shl   ax,16
  894.   mov   al,col
  895.   mov   ah,al
  896.   mov   cx,x2
  897.   sub   cx,x1
  898.  
  899.   mov   bx,4
  900.   shr   cx,1
  901.   jnc   @start
  902.  
  903.   cmp   yn,1
  904.   je    @tr
  905.   stosb
  906.   jmp   @start
  907.  
  908. @tr:
  909.  
  910.   movsb
  911.  
  912. @Start :
  913.  
  914.   cmp   yn,1
  915.   je    @tru
  916.   rep   stosw
  917.   jmp   @stp
  918.  
  919. @tru:
  920.  
  921.   rep   movsw
  922.  
  923. @stp:
  924.      pop ds
  925.      pop es
  926. end;
  927.  
  928. PROCEDURE FillPolygon(Size:Integer; VAR P1; C:Byte;where:word;yn:boolean);
  929. TYPE
  930.     Vektor=RECORD
  931.                  X,Y,XMax,DX,DY,DZ,Z,Spalte:Integer;
  932.            END;
  933.     VekPoly=ARRAY[1..VekMax,1..2,1..2] OF Integer;
  934. VAR
  935.    P:ARRAY[1..VekMax,1..2] OF Integer ABSOLUTE P1;
  936.    Sp:VekPoly;
  937.    NF:Boolean;
  938.    V:ARRAY[1..VekMax] OF Vektor;
  939.    S:ARRAY[1..2*VekMax] OF Integer;
  940.    I,J,K,N,SX,YRMin,YRMax,YR,XMin,YMin,YMax,I2:Integer;
  941. BEGIN
  942.      IF Size>VekMax THEN
  943.         Exit;
  944.      K:=1;
  945.      FOR I:=1 TO Size DO
  946.      BEGIN
  947.           Sp[K,1,1]:=P[I,1];
  948.           Sp[K,1,2]:=P[I,2];
  949.           IF I=Size THEN
  950.           BEGIN
  951.                Sp[K,2,1]:=P[1,1];
  952.                Sp[K,2,2]:=P[1,2];
  953.           END
  954.           ELSE
  955.           BEGIN
  956.                Sp[K,2,1]:=P[I+1,1];
  957.                Sp[K,2,2]:=P[I+1,2];
  958.           END;
  959.           IF Sp[K,2,2]-Sp[K,1,2]<0 THEN
  960.           BEGIN
  961.                J:=Sp[K,2,1];
  962.                Sp[K,2,1]:=Sp[K,1,1];
  963.                Sp[K,1,1]:=J;
  964.                J:=Sp[K,2,2];
  965.                Sp[K,2,2]:=Sp[K,1,2];
  966.                Sp[K,1,2]:=J;
  967.           END;
  968.           Inc(K);
  969.      END;
  970.      YRMin:=199;
  971.      YRMax:=0;
  972.      FOR K:=1 TO Size DO
  973.          FOR I:=1 TO 2 DO
  974.          BEGIN
  975.               IF Sp[K,I,2]>YRMax THEN
  976.                  YRMax:=Sp[K,I,2];
  977.               IF Sp[K,I,2]<YRMin THEN
  978.                  YRMin:=Sp[K,I,2];
  979.          END;
  980.      IF YRMin<0 THEN
  981.         YRMin:=0;
  982.      IF YRMax>199 THEN
  983.         YRMax:=199;
  984.      FOR K:=1 TO Size DO
  985.          WITH V[K] DO
  986.          BEGIN
  987.               XMin:=Sp[K,1,1];
  988.               YMin:=Sp[K,1,2];
  989.               XMax:=Sp[K,2,1];
  990.               YMax:=Sp[K,2,2];
  991.               DX:=Abs(XMin-XMax);
  992.               DY:=Abs(YMin-YMax);
  993.               X:=XMin;
  994.               Y:=YMin;
  995.               IF XMin<XMax THEN
  996.                  Z:=1
  997.               ELSE Z:=-1;
  998.               IF DX>DY THEN
  999.                  I2:=DX
  1000.               ELSE I2:=DY;
  1001.               DZ:=I2 DIV 2;
  1002.               Spalte:=XMin;
  1003.          END;
  1004.      FOR YR:=YRMin TO YRMax DO
  1005.      BEGIN
  1006.           N:=0;
  1007.           FOR K:=1 TO Size DO
  1008.               IF ((Sp[K,1,2]<=YR) AND (YR<SP[K,2,2])) OR ((YR=YRMax) AND (YRMax=Sp[K,2,2]) AND (YRMax<>Sp[K,1,2])) THEN
  1009.               BEGIN
  1010.                    WITH V[K] DO
  1011.                    BEGIN
  1012.                         Inc(N);
  1013.                         S[N]:=X;
  1014.                         SX:=X;
  1015.                         REPEAT
  1016.                               IF DZ<DX THEN
  1017.                               BEGIN
  1018.                                    DZ:=DZ+DY;
  1019.                                    X:=X+Z;
  1020.                               END;
  1021.                               IF DZ>=DX THEN
  1022.                               BEGIN
  1023.                                    DZ:=DZ-DX;
  1024.                                    Inc(Y);
  1025.                               END;
  1026.                               IF Y=YR THEN
  1027.                                  SX:=X;
  1028.                               Inc(Spalte,Z);
  1029.                         UNTIL (Y>YR) OR (Spalte=XMax);
  1030.                         Inc(N);
  1031.                         S[N]:=SX;
  1032.                    END;
  1033.               END;
  1034.           FOR I:=2 TO N DO
  1035.               FOR K:=N DOWNTO I DO
  1036.                   IF S[K-1]>S[K] THEN
  1037.                   BEGIN
  1038.                        J:=S[K-1];
  1039.                        S[K-1]:=S[K];
  1040.                        S[K]:=J;
  1041.                   END;
  1042.           K:=1;
  1043.           WHILE K<=N DO
  1044.           BEGIN
  1045.                IF S[K]<0 THEN
  1046.                   S[K]:=0;
  1047.                IF S[K+3]>319 THEN
  1048.                   S[K+3]:=319;
  1049.                HLine(S[K],S[K+3],YR,C,where,yn);
  1050.                K:=K+4;
  1051.           END;
  1052.      END;
  1053. END;
  1054.  
  1055. procedure QuickSort( Lo, Hi: Integer);
  1056.  procedure Sort(l, r: Integer);
  1057.  var
  1058.     i, j, x, y: integer;
  1059.  begin
  1060.       i := l;
  1061.       j := r;
  1062.       x := polyz[(l+r) DIV 2];
  1063.       repeat
  1064.             while polyz[i] < x do i := i + 1;
  1065.             while x < polyz[j] do j := j - 1;
  1066.             if i <= j then
  1067.             begin
  1068.                  y := polyz[i];
  1069.                  polyz[i] := polyz[j];
  1070.                  polyz[j] := y;
  1071.                  y := Pind[i];
  1072.                  Pind[i] := Pind[j];
  1073.                  Pind[j] := y;
  1074.                  i := i + 1;
  1075.                  j := j - 1;
  1076.             end;
  1077.       until i > j;
  1078.  
  1079.       if l < j then Sort(l, j);
  1080.       if i < r then Sort(i, r);
  1081.  end;
  1082.  
  1083. begin
  1084.       Sort(Lo,Hi);
  1085. end;
  1086.  
  1087. function Sinus(Idx : byte) : integer;
  1088. begin
  1089.      Sinus := SinTab[Idx];
  1090. end;
  1091.  
  1092. function Cosinus(Idx : byte) : integer;
  1093. begin
  1094.      Cosinus := SinTab[(Idx+192) mod 255];
  1095. end;
  1096.  
  1097.  
  1098.  
  1099.  
  1100.  
  1101.  
  1102.  
  1103. var
  1104.      FntEs,FntBp,fnt1seg,fnt1ofs:Word;
  1105.      FontPal1  : Palet;
  1106.      MyBMfnt1  : Pointer;
  1107.  
  1108.  
  1109. Procedure WrBitMapFnt(FntPtr:Pointer;Xsize,Ysize:Byte;XX,YY:Word;DStr:String);
  1110. Var
  1111.  AA,BB,CC,OffST:Word;
  1112.  FntSeg,FntOfs,Ofs1:Word;
  1113.  AscV:Byte;
  1114. Begin
  1115.  FntSeg:=Seg(Fnt001);
  1116.  FntOfs:=Ofs(Fnt001);
  1117.  For CC:=1 to Length(Dstr) do
  1118.  Begin
  1119.   AscV:=Ord(Dstr[CC]);
  1120.   If (AscV<32) or (AscV>90) then AscV:=32;
  1121.   For AA:=1 to Ysize do
  1122.   Begin
  1123.    For BB:=1 to Xsize do
  1124.    Begin
  1125.     Ofs1:=((Xsize*Ysize)*(AscV-32)) + (((AA-1)*Xsize)+(BB-1));
  1126.     If Mem[FntSeg:FntOfs+Ofs1]<>0 then begin
  1127. {     Mem[$A000:OffST]:=Mem[FntSeg:FntOfs+Ofs1];}
  1128.      Mem[seg(p^):OffST]:=Mem[FntSeg:FntOfs+Ofs1];
  1129.      end;
  1130.     OffST:=(YY+AA-1)*320+(XX+BB-1);
  1131.    End;
  1132.   End;
  1133.   Inc(XX,Xsize);
  1134.  End;
  1135. End;
  1136.  
  1137. Procedure ClrBOX(x,y,X1,Y1:word);
  1138. Var
  1139.   I,I1 : Integer;
  1140.  
  1141. begin
  1142.  For I:=x to x1 do
  1143.   for I1:=y to y1 do
  1144.   begin
  1145.    mem[seg(p^):I+(I1*320)]:=0;
  1146.   end;
  1147.  
  1148. end;
  1149. procedure wol(x,y,al:WORD;str:CHAR);
  1150. begin
  1151.  x:=x*16+al;
  1152.  WrBitMapFnt(MyBMfnt1,16,16,x,y,str);
  1153. end;
  1154.  
  1155. procedure showlines(bl,al:byte;str:string);
  1156. var x:byte;
  1157. begin
  1158. For x:=1 to Length(str) do
  1159. wol(x,bl,al,str[x]);
  1160. END;
  1161.  
  1162.  
  1163. procedure FontPal(base,gchn,bchn:byte);
  1164. var cx:byte;
  1165. begin
  1166.  for cx:=1 to 15 do
  1167.  sc(cx,base,63-(gchn*cx),63-(bchn*cx));
  1168. end;
  1169.  
  1170.  
  1171.  
  1172.  
  1173.   var
  1174.     loop : integer;
  1175.     font : array [0..255, 0..15] of byte;
  1176.  
  1177.   Procedure LoadROMFont;
  1178.  
  1179.     var
  1180.       f8x8ofs, f8x8seg : word;
  1181.  
  1182.     begin
  1183.       asm
  1184.         push bp
  1185.         mov ah,11h
  1186.         mov al,30h
  1187.         mov bh,06h
  1188.         int 10h
  1189.         mov ax,bp
  1190.         pop bp
  1191.         mov f8x8ofs,ax
  1192.         mov f8x8seg,es
  1193.       end;
  1194.       move(mem[f8x8seg:f8x8ofs],font,256*16)
  1195.     end;
  1196.  
  1197.   Procedure GrWrite (line : string; x, y : integer; forecolor : byte);
  1198.  
  1199.     var
  1200.       tx,ty:word;
  1201.       i:byte;
  1202.  
  1203.     begin
  1204.       for i:=1 to length(line) do
  1205.         for ty:=0 to 15 do
  1206.           for tx:=0 to 7 do
  1207.             if font[ord(line[i]),ty] and ($80 shr tx)<>0 then
  1208.               putpixel(x+tx+(i-1)*10, y+ty, forecolor)
  1209.     end;
  1210.  
  1211.   procedure CenterText (str : string; y : integer; color : byte);
  1212.  
  1213.     begin
  1214.       GrWrite (Str, HalfX - ((length (Str) * 10) div 2), y, Color)
  1215.     end;
  1216.  
  1217.  
  1218.  
  1219.  
  1220. var vvv:word;
  1221.     VVX:INTEGER;
  1222.     PART,cor:BYTE;
  1223.  
  1224. begin
  1225.  Move(Mem[Seg(PIC001):(Ofs(PIC001)+10)],Pic1Pal[0],768);
  1226.  Move(Mem[Seg(PIC001):(Ofs(PIC001)+10)],Pal[0],768);
  1227.  Pic1Seg:=Seg(PIC001);Pic1Ofs:=Ofs(PIC001)+778;
  1228.  
  1229.     part:=1;
  1230.      calcsinus(Sintab);
  1231.  
  1232.      asm
  1233.         mov ax,13h
  1234.         int 10h
  1235.      end;
  1236.  
  1237.         LoadSong (Musik);
  1238.               StartMusic(Musik.Song,FALSE,TRUE);
  1239.  
  1240.      
  1241.  
  1242.      getmem(p,64000);
  1243.  updpalette(pic1pal);
  1244.  Move(Mem[Pic1Seg:Pic1Ofs],Mem[$A000:0],64000);
  1245.  Move(Mem[Pic1Seg:Pic1Ofs],p^,64000);
  1246.  move(p^,mem[$a000:0],64000);
  1247.  loadROMfont;
  1248.       FontPal(30,4,2);
  1249.  
  1250.      SetUpVirtual;
  1251.  
  1252.      move(p^,virscr^,64000);
  1253.  
  1254.      fillchar(px,sizeof(px),0);
  1255.      fillchar(py,sizeof(py),0);
  1256.      fillchar(pz,sizeof(py),0);
  1257.      shaq:=1;
  1258.  
  1259.   Top:=19;  Bottom:=45; orr:=true;
  1260.   mult:=2;        { <--------------- This controls on the wobble size!}
  1261.   for imb := 0 to range do
  1262.   sins[imb] := round(sin(imb*pi/rang)*mult);
  1263.   s := seg(p^);
  1264.   o := ofs(p^);
  1265.   imb := 0;
  1266.   counter := 0;   { <--------------- This does NOT control on the wobble size!}
  1267.   yay := top;
  1268.  
  1269.  zoff:=zoff-26;
  1270.  xoff:=50;
  1271.    yoff:=250;
  1272.  
  1273.   repeat
  1274.    dec(yoff);
  1275.             for i:= 0 to 5 do
  1276.            begin
  1277.                 pc:=pind[i];
  1278.                 for j:=1 to 4 do
  1279.                 begin
  1280.                      plg[j,1]:=px[polyst[pc,j-1]];
  1281.                      plg[j,2]:=py[polyst[pc,j-1]];
  1282.                 end;
  1283.                 fillpolygon(4,plg,0,s,true);
  1284.            end;
  1285.  
  1286.            for I := 0 to 7 do
  1287.            begin
  1288.                 X1 := (Cosinus(PhiY)*Point[I,0]-Sinus(PhiY)*Point[I,2]) div 128;
  1289.                 Y1 := (Cosinus(PhiZ)*Point[I,1]-Sinus(PhiZ)*X1) div 128;
  1290.                 Z1 := (Cosinus(PhiY)*Point[I,2]+Sinus(PhiY)*Point[I,0]) div 128;
  1291.                 X := (Cosinus(PhiZ)*X1+Sinus(PhiZ)*Point[I,1]) div 128;
  1292.                 Y := (Cosinus(PhiX)*Y1+Sinus(PhiX)*Z1) div 128;
  1293.                 Z := (Cosinus(Phix)*Z1-Sinus(Phix)*Y1) div 128;
  1294.                 PX[I] := xoff+(Xc*Z-X*zoff) div (Z-Zc) ;     {store py}
  1295.                 PY[I] := yoff+(Yc*Z-Y*zoff) div (Z-Zc) ;     {store px}
  1296.                 PZ[I] := Z ;                                 {store pz}
  1297.            end;
  1298.  
  1299.            For I:=0 to nofpolys do
  1300.            begin
  1301.                 polyz[I]:=pz[polyst[i,0]];          {add the zvalues of}
  1302.                 polyz[I]:=Polyz[i]+pz[polyst[i,1]]; {the the points of }
  1303.                 polyz[I]:=Polyz[i]+pz[polyst[i,2]]; {the triangle}
  1304.                 polyz[I]:=Polyz[i]+pz[polyst[i,3]]; {the triangle}
  1305.                 Pind[I]:=I;                         {index to point to Polygons}
  1306.            end;
  1307.  
  1308.            if shaq=0 then
  1309.               QuickSort( 0, 5); {sort the z-values of the polygones
  1310.                                  the farest triangle must be drawn first}
  1311.  
  1312.            inc(Phix,xstep);         {Rotate the axis}
  1313.            inc(Phiy,ystep);
  1314.            inc(PhiZ,Zstep);
  1315.            for i:= 0 to 5 do
  1316.            begin
  1317.                 pc:=pind[i];
  1318.                 for j:=1 to 4 do
  1319.                 begin
  1320.                      plg[j,1]:=px[polyst[pc,j-1]];
  1321.                      plg[j,2]:=py[polyst[pc,j-1]];
  1322.                 end;
  1323.                 fillpolygon(4,plg,polcols[pc],s,false);
  1324.            end;
  1325.  
  1326.            flip(vad,vseg);
  1327.  
  1328.    until yoff = 115;
  1329.  
  1330.  
  1331.             shaq:=0;
  1332.  
  1333.  
  1334.  
  1335.  
  1336.  
  1337.  
  1338.  
  1339.  
  1340. { zoff:=zoff-26;}
  1341.  xoff:=44;
  1342. { yoff:=yoff+15;}
  1343.  CLRBOX(10,75,255,200);
  1344.                             showlines(082,10,' XLNET SITE ');
  1345.                             showlines(108,10,'24HRS ONLINE');
  1346.                             showlines(134,15,'14.4K MODEM');
  1347.  
  1348.  
  1349.            vvx:=1;
  1350.      repeat
  1351.            inc(vvv);
  1352.                       xoff:=xoff+vvx;
  1353.            for i:= 0 to 5 do
  1354.            begin
  1355.                 pc:=pind[i];
  1356.                 for j:=1 to 4 do
  1357.                 begin
  1358.                      plg[j,1]:=px[polyst[pc,j-1]];
  1359.                      plg[j,2]:=py[polyst[pc,j-1]];
  1360.                 end;
  1361.                 fillpolygon(4,plg,0,s,true);
  1362.            end;
  1363.  
  1364.            for I := 0 to 7 do
  1365.            begin
  1366.                 X1 := (Cosinus(PhiY)*Point[I,0]-Sinus(PhiY)*Point[I,2]) div 128;
  1367.                 Y1 := (Cosinus(PhiZ)*Point[I,1]-Sinus(PhiZ)*X1) div 128;
  1368.                 Z1 := (Cosinus(PhiY)*Point[I,2]+Sinus(PhiY)*Point[I,0]) div 128;
  1369.                 X := (Cosinus(PhiZ)*X1+Sinus(PhiZ)*Point[I,1]) div 128;
  1370.                 Y := (Cosinus(PhiX)*Y1+Sinus(PhiX)*Z1) div 128;
  1371.                 Z := (Cosinus(Phix)*Z1-Sinus(Phix)*Y1) div 128;
  1372.                 PX[I] := xoff+(Xc*Z-X*zoff) div (Z-Zc) ;     {store py}
  1373.                 PY[I] := yoff+(Yc*Z-Y*zoff) div (Z-Zc) ;     {store px}
  1374.                 PZ[I] := Z ;                                 {store pz}
  1375.            end;
  1376.  
  1377.            For I:=0 to nofpolys do
  1378.            begin
  1379.                 polyz[I]:=pz[polyst[i,0]];          {add the zvalues of}
  1380.                 polyz[I]:=Polyz[i]+pz[polyst[i,1]]; {the the points of }
  1381.                 polyz[I]:=Polyz[i]+pz[polyst[i,2]]; {the triangle}
  1382.                 polyz[I]:=Polyz[i]+pz[polyst[i,3]]; {the triangle}
  1383.                 Pind[I]:=I;                         {index to point to Polygons}
  1384.            end;
  1385.  
  1386.            if shaq=0 then
  1387.               QuickSort( 0, 5); {sort the z-values of the polygones
  1388.                                  the farest triangle must be drawn first}
  1389.  
  1390.            inc(Phix,xstep);         {Rotate the axis}
  1391.            inc(Phiy,ystep);
  1392.            inc(PhiZ,Zstep);
  1393.            for i:= 0 to 5 do
  1394.            begin
  1395.                 pc:=pind[i];
  1396.                 for j:=1 to 4 do
  1397.                 begin
  1398.                      plg[j,1]:=px[polyst[pc,j-1]];
  1399.                      plg[j,2]:=py[polyst[pc,j-1]];
  1400.                 end;
  1401.                 fillpolygon(4,plg,polcols[pc],s,false);
  1402.            end;
  1403.  
  1404.            flip(vad,vseg);
  1405.  
  1406.              Case vvv of
  1407.                226:     vvx:=0;
  1408.                228:     CLRBOX(10,75,212,165);
  1409.                286:     begin
  1410.                             showlines(082,84,'SYSOP......');
  1411.                             showlines(108,84,'RONEN PELEG');
  1412.                             showlines(134,89,'           ');
  1413.  
  1414.                         end;
  1415.                300:     vvx:=-1;
  1416.                513:     VVX:=0;
  1417.                568:     CLRBOX(10,75,255,200);
  1418.                569:     begin
  1419.                             showlines(082,10,' MANY PICS  ');
  1420.                             showlines(108,10,'ONLINE GAMES');
  1421.                             showlines(134,15,' NEW FILES ');
  1422.                         end;
  1423.                570:     vvx:=1;
  1424.                780:     vvx:=0;
  1425.                835:     CLRBOX(10,75,310,200);
  1426.                836:     begin
  1427.                             showlines(96,74,'JUST CALL');
  1428.  
  1429.                         end;
  1430.                837:     vvx:=-1;
  1431.               1050:     vvx:=0;
  1432.  
  1433. {
  1434.                                GetPlayerState (Info);
  1435. }
  1436. {
  1437.   if (HeadPTR <> TailPTR) then HeadPTR := TailPTR;
  1438. }
  1439.      end;
  1440.      until (keypressed) OR (vvv=1065);
  1441.      if keypressed then begin
  1442.                           ch:=readkey;
  1443.                           goto Jm1;
  1444.                         end;
  1445.  
  1446.  
  1447.   shaq:=1;
  1448.   repeat
  1449.   {
  1450.                    GetPlayerState (Info);
  1451.   }{
  1452.    if (HeadPTR <> TailPTR) then HeadPTR := TailPTR;
  1453. }
  1454.    inc(yoff);
  1455.             for i:= 0 to 5 do
  1456.            begin
  1457.                 pc:=pind[i];
  1458.                 for j:=1 to 4 do
  1459.                 begin
  1460.                      plg[j,1]:=px[polyst[pc,j-1]];
  1461.                      plg[j,2]:=py[polyst[pc,j-1]];
  1462.                 end;
  1463.                 fillpolygon(4,plg,0,s,true);
  1464.            end;
  1465.  
  1466.            for I := 0 to 7 do
  1467.            begin
  1468.                 X1 := (Cosinus(PhiY)*Point[I,0]-Sinus(PhiY)*Point[I,2]) div 128;
  1469.                 Y1 := (Cosinus(PhiZ)*Point[I,1]-Sinus(PhiZ)*X1) div 128;
  1470.                 Z1 := (Cosinus(PhiY)*Point[I,2]+Sinus(PhiY)*Point[I,0]) div 128;
  1471.                 X := (Cosinus(PhiZ)*X1+Sinus(PhiZ)*Point[I,1]) div 128;
  1472.                 Y := (Cosinus(PhiX)*Y1+Sinus(PhiX)*Z1) div 128;
  1473.                 Z := (Cosinus(Phix)*Z1-Sinus(Phix)*Y1) div 128;
  1474.                 PX[I] := xoff+(Xc*Z-X*zoff) div (Z-Zc) ;     {store py}
  1475.                 PY[I] := yoff+(Yc*Z-Y*zoff) div (Z-Zc) ;     {store px}
  1476.                 PZ[I] := Z ;                                 {store pz}
  1477.            end;
  1478.  
  1479.            For I:=0 to nofpolys do
  1480.            begin
  1481.                 polyz[I]:=pz[polyst[i,0]];          {add the zvalues of}
  1482.                 polyz[I]:=Polyz[i]+pz[polyst[i,1]]; {the the points of }
  1483.                 polyz[I]:=Polyz[i]+pz[polyst[i,2]]; {the triangle}
  1484.                 polyz[I]:=Polyz[i]+pz[polyst[i,3]]; {the triangle}
  1485.                 Pind[I]:=I;                         {index to point to Polygons}
  1486.            end;
  1487.  
  1488.            if shaq=0 then
  1489.               QuickSort( 0, 5); {sort the z-values of the polygones
  1490.                                  the farest triangle must be drawn first}
  1491.  
  1492.            inc(Phix,xstep);         {Rotate the axis}
  1493.            inc(Phiy,ystep);
  1494.            inc(PhiZ,Zstep);
  1495.            for i:= 0 to 5 do
  1496.            begin
  1497.                 pc:=pind[i];
  1498.                 for j:=1 to 4 do
  1499.                 begin
  1500.                      plg[j,1]:=px[polyst[pc,j-1]];
  1501.                      plg[j,2]:=py[polyst[pc,j-1]];
  1502.                 end;
  1503.                 fillpolygon(4,plg,polcols[pc],s,false);
  1504.            end;
  1505.  
  1506.            flip(vad,vseg);
  1507.  
  1508.    until yoff = 260;
  1509.  
  1510.  
  1511.  
  1512.      ShutDown;
  1513.      CLRBOX(10,75,212,165);
  1514.  
  1515.  
  1516.  
  1517.   getdata;
  1518.   randomize;
  1519.   bobbing := false;
  1520.   SBob := true;
  1521.   ShowPhone;
  1522. vvv:=0;
  1523.  
  1524.      repeat
  1525. {
  1526.                       GetPlayerState (Info);
  1527. }{
  1528.       if (HeadPTR <> TailPTR) then HeadPTR := TailPTR;
  1529. }
  1530.  
  1531.         Wobbler(top,bottom,mult);
  1532.         inc(vvv);
  1533.         inc(eee);
  1534.                if eee=3 then begin
  1535.                               eee:=0;
  1536.                               delay(1);
  1537.                              end;
  1538.         Case vvv of
  1539.            10:  Showphone;
  1540.           390:  grwrite ('CODING:',1, 70, 18);
  1541.          3960:  grwrite ('CiVAX',270,120,210);
  1542.         end;
  1543.  
  1544.      until keypressed;
  1545.  
  1546. jm1:
  1547.  
  1548.      freemem(p,64000);
  1549.      asm
  1550.         mov ax,3h
  1551.         int 10h
  1552.      end; Textcolor(15);
  1553. write ('INTRO CODED BY'); textcolor(11);write(' C');textcolor(3);write('i');textcolor(11);write('VAX');
  1554. textcolor(15);write(' ''94.  ');textcolor(7);writeln(' Also used:');
  1555. TextColor(9);write('3D rotating routines by');textcolor(10);writeln(' PLAVIUS');
  1556. textcolor(6);write('Player & Tune by');textcolor(12);writeln(' CHIKEN/ECR.');
  1557. textcolor(7);
  1558.      stopmusic;
  1559. end.
  1560.